package com.xiaoyi.springboot.exception;

import com.xiaoyi.springboot.enums.ExceptionInfoEnum;
import lombok.Data;

@Data
public class MAuthenticationException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    private final String errorCode;
    public MAuthenticationException(String msg, String code) {
        super(msg);
        this.errorCode = code;
    }
    public MAuthenticationException(String errorMsg) {
        super(errorMsg);
        this.errorCode = ExceptionInfoEnum.ERROR.getErrorCode();
    }

    public MAuthenticationException(String errorMsg, Throwable e) {
        super(errorMsg,e);
        this.errorCode = ExceptionInfoEnum.ERROR.getErrorCode();
    }


    public MAuthenticationException(ExceptionInfoEnum e) {
        super(e.getErrorMsg());
        this.errorCode = e.getErrorCode();
    }
}
